package com.halko.PR.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * 配置启动类
 * @author halko
 * @create 2021-04-08 16:44
 */
@Component
public class CommandRunner implements CommandLineRunner {

    @Value("${server.port}")
    private String port;

    @Override
    public void run(String... args) throws Exception {
        try {
            String os = System.getProperty("os.name").toLowerCase();
            if (os.contains("windows")) {
                Runtime.getRuntime().exec("cmd   /c   start   https://gitee.com/cenhalko/pr");
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }

}
